package com.lh.java.basic.reflect;

interface China {
	public static final String name = "Rollen";
	public static int age = 20;

	public void sayChina();

	public void sayHello(String name, int age);
}
interface HaHa {	
	public void sayHaHa();
}
class A{
	
}

class Person2 extends A implements China ,HaHa{
	public Person2() {

	}

	public Person2(String sex) {
		this.sex = sex;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Override
	public void sayChina() {
		System.out.println("hello ,china");
	}

	@Override
	public void sayHello(String name, int age) {
		System.out.println(name + "  " + age);
	}
	
	public void sayHaHa(){
		System.out.println("haha");
	}

	private String sex;
	public String ccString;
}

public class GetInterface {
	public static void main(String[] args) {
		Class<?> demo = null;
		try {
			demo = Class.forName("com.lh.reflect.Person2");
		} catch (Exception e) {
			e.printStackTrace();
		}
		// 保存所有的接口
		Class<?> intes[] = demo.getInterfaces();
		for (int i = 0; i < intes.length; i++) {
			System.out.println("实现的接口   " + intes[i].getName());
		}
		Class<?> temp=demo.getSuperclass().getSuperclass();
        System.out.println("继承的父类为：   "+temp.getName());
	}
}